import { _decorator, Component, director, Node, tween } from 'cc';
import { Globals } from './Globals';
import { ProgressBar } from './ProgressBar';
const { ccclass, property } = _decorator;

@ccclass('Start')
export class Start extends Component {
    start() {
        Globals.init().then(()=> {
            // 场景跳转 Globals
            // this.scheduleOnce(()=> {
                director.loadScene("Main");
            // },3);
            
            
            // TEST
            // const ndBar = this.node.getChildByName('LoadingBar');
            // ndBar.getComponent(ProgressBar).setProgress(0);
            // let prgs = 0;
            // let ac = tween(ndBar)
            // .delay(0.2)
            // .call(()=> {
            //     prgs += 0.1;
            //     ndBar.getComponent(ProgressBar).setProgress(prgs);
            // });
            // tween(ndBar).repeat(10, ac).start();

            
        })
    }

    update(deltaTime: number) {
        
    }
}


